// ... existing code ...

// 添加属性来记录当前选中的文件cell下标
@property (nonatomic, assign) NSInteger currentFileIndex;

// ... existing code ...

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    HomeUnitModel * model = self.dataSource[indexPath.row];
    
    if ([model.name isEqualToString:@"common_file"]) { // 文件上传
        // 保存当前选中的下标
        self.currentFileIndex = indexPath.row;
        
        NSArray *documentTypes = @[@"public.image", @"com.adobe.pdf"];
        UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:documentTypes inMode:UIDocumentPickerModeImport];
        documentPicker.delegate = self;
        documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
        [self presentViewController:documentPicker animated:YES completion:nil];
    }
    
    // ... existing code ...
}

#pragma mark -- UIDocumentPickerDelegate
-(void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url {
    // 获取文件名
    NSString *filename = [url lastPathComponent];
    
    // 读取文件数据
    NSData *fileData = [NSData dataWithContentsOfURL:url];
    
    [self.uploadImgManager uploadImageWithParam:@{@"filename":filename} sourceImg:[UIImage imageWithData:fileData] completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
        if (responseObject && [responseObject[@"code"] intValue] == 200) {
            // 解析返回数据
            NSString *str = [SStringUtils jsonStringWithParameters:responseObject[@"data"]];
            NSData *dicData = [str dataUsingEncoding:NSUTF8StringEncoding];
            NSError *dicErr;
            NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:dicData 
                                                              options:NSJSONReadingMutableContainers 
                                                              error:&dicErr];
            
            // 更新对应下标的model
            HomeUnitModel *model = self.dataSource[self.currentFileIndex];
            model.props.url = dic[@"url"];
            model.props.filename = dic[@"name"];
            
            // 刷新对应的cell
            NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.currentFileIndex inSection:0];
            HomeUploadFileTableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
            [cell.fileBtn setTitle:filename forState:UIControlStateNormal];
        }
    }];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    HomeUnitModel * model = self.dataSource[indexPath.row];
    
    if (![model.valueType isEqualToString:@"Image"] && ![model.name isEqualToString:@"common_apply_pass_region"] && ![model.name isEqualToString:@"tool_pass_region"] && ![model.name isEqualToString:@"tool_table"] && ![model.name isEqualToString:@"common_file"]) {
        
        // 修改1: 不要重用cell,每次创建新的cell
        ZJPublicFormTableViewCell * cell = [[ZJPublicFormTableViewCell alloc]initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"ZJPublicFormTableViewCell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.model = model;
        return cell;
        
    } else if ([model.name isEqualToString:@"common_apply_pass_region"] || [model.name isEqualToString:@"tool_pass_region"]){ 
        // 修改2: 同样不重用cell
        ZJPublicFormAreatTableViewCell * cell = [[ZJPublicFormAreatTableViewCell alloc]initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"ZJPublicFormAreatTableViewCell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.model = model;
        return cell;
        
    } else if ([model.name isEqualToString:@"tool_table"]){
        // 修改3: 同样不重用cell 
        HomeAddGoodsTableViewCell * cell = [[HomeAddGoodsTableViewCell alloc]initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"HomeAddGoodsTableViewCell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.model = model;
        // ... 其他cell设置代码 ...
        return cell;
        
    } else if ([model.name isEqualToString:@"common_file"]){
        // 修改4: 同样不重用cell
        HomeUploadFileTableViewCell * cell = [[HomeUploadFileTableViewCell alloc]initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"HomeUploadFileTableViewCell"]; 
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.model = model;
        return cell;
        
    } else {
        // 修改5: 图片上传cell也不重用
        ZJPublicUploadPhotoTableViewCell * cell = [[ZJPublicUploadPhotoTableViewCell alloc]initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"ZJPublicUploadPhotoTableViewCell"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        if ([model.props.required boolValue] == YES){
            cell.relabel.hidden = NO;
        }else{
            cell.relabel.hidden = YES;
        }
        
        cell.titleLabel.text = model.props.title;
        cell.uploadLabel.text = model.props.placeholder;
        return cell;
    }
    
    return [UITableViewCell new];
}

// ... existing code ... 